package com.homedo.odin.solution.service.bizservice.home;

import com.homedo.core.common.util.ObjectConverter;
import com.homedo.odin.solution.contract.pc.TopBountysResp;
import com.homedo.odin.solution.model.dto.TopBountys;
import com.homedo.odin.solution.model.entity.Bounty;
import com.homedo.odin.solution.service.BountyServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author: donglibing
 * @date: 2018/3/7 19:06
 * @Description: home
 */
@Service
public class HomeBizService {

    @Autowired
    BountyServiceImpl bountyService;

    /**
     * 获取每日悬赏
     */
    public TopBountysResp topbountys(int top) {
        TopBountysResp resp = new TopBountysResp();
        List<Bounty> bountyList = bountyService.topbountys(top);
        List<TopBountys> topBountys = ObjectConverter.copyList(bountyList, TopBountys.class);
        resp.setTopBountys(topBountys);
        return resp;
    }
}
